/*
 * @Author: szx
 * @Date: 2022-02-13 12:31:57
 * @LastEditTime: 2022-02-13 12:56:28
 * @Description:
 * @FilePath: \leetcode\1700-1799\1763\1763.js
 */
/**
 * @param {string} s
 * @return {string}
 */
// var longestNiceSubstring = function (s) {
//     let left = 0;
//     let right = 0;
//     for (let i = 0; i < s.length; i++) {
//         let lower = 0;
//         let upper = 0;
//         for (let j = i; j < s.length; j++) {
//             if ('a' <= s[j] && 'z' >= s[j]) {
//                 lower |= 1 << (s.charCodeAt(j) - 97);
//             } else {
//                 upper |= 1 << (s.charCodeAt(j) - 65);
//             }
//             if (upper == lower && j - i > right - left - 1) {
//                 right = j + 1;
//                 left = i;
//             }
//         }
//     }
//     return s.slice(left, right);
// };

var longestNiceSubstring = function (s) {
    let left = 0;
    let right = 0;
    let tmp_left = 0;
    let tmp_right = 0;
    for (let i = 0; i < s.length; i++) {
        let lower = 0;
        let upper = 0;
        if ('a' <= s[j] && 'z' >= s[j]) {
            lower |= 1 << (s.charCodeAt(j) - 97);
        } else {
            upper |= 1 << (s.charCodeAt(j) - 65);
        }
        if (lower == upper) {
        }
    }
    return s.slice(left, right);
};
console.log(longestNiceSubstring('dDzeE'));
